package com.maolong.controller.manger;

import com.maolong.entity.format.Code;
import com.maolong.entity.format.RespResult;
import com.maolong.exception.ServerException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ExceptionController {

    @GetMapping("/exception")
    public RespResult testException(){
        try {
            int i = 1/0;
        }catch (Exception e){
            throw new ServerException(Code.EXCEPTION,"服务器繁忙，稍后再试");
        }
        return new RespResult(null,null,null);
    }
}
